#pragma once
#ifndef COLLISION_MANAGER_H
#define COLLISION_MANAGER_H

#include <map>
#include <Box2D.h>

using namespace std;

class CollisionManager : public b2ContactListener
{
public:

	static CollisionManager* getInstance();

	static void dropInstance();

	virtual void Add(const b2ContactPoint* point);

	virtual void Persist(const b2ContactPoint* point);

	virtual void Remove(const b2ContactPoint* point);

	bool isOnGround(b2Shape* shapeToTest) const;

	bool isOnWall(b2Shape* shapeToTest) const;

protected:
	
	CollisionManager();

	virtual ~CollisionManager();

private:

	map<int, b2ContactPoint> contactPoints;

	static CollisionManager* singleton;
};

#endif //COLLISION_MANAGER_H
